package com.ifar.audiosdk.api

import com.ifar.audiosdk.common.IfarBaseResponse
import com.ifar.audiosdk.model.login.model.LoginEntity
import com.ifar.audiosdk.model.main.model.CheckUserCallStateEntity
import com.ifar.audiosdk.model.main.model.UpdateUsersCallStateEntity
import com.ifar.audiosdk.model.main.model.UserListEntity
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

interface IfarBaseApi {

    companion object {
        var BASE_URL = "https://devserver.anyremote.cn"
    }

    @FormUrlEncoded
    @POST("/index.php/api/common/index")
    suspend fun login(
        @Field("fun_name") fun_name: String,
        @Field("login_id") login_id: String,
        @Field("login_password") login_password: String,
        @Field("sign_id") sign_id: String,
        @Field("peer_id") peer_id: String,
        @Field("user_group") user_group: String,
        @Field("request_from") request_from: String,
        @Field("app_version") app_version: String
    ): IfarBaseResponse<LoginEntity>

    @FormUrlEncoded
    @POST("/index.php/api/common/index")
    suspend fun getUserList(
        @Field("fun_name") fun_name: String,
        @Field("company_id") company_id: String,
        @Field("uid") uid: String,
        @Field("token") token: String
    ): IfarBaseResponse<UserListEntity>

    @FormUrlEncoded
    @POST("/index.php/api/common/index")
    suspend fun updateUsersCallState(
        @Field("fun_name") fun_name: String,
        @Field("userIDs") company_id: String,
        @Field("uid") uid: String,
        @Field("token") token: String,
        @Field("channel_id") channel_id: String
    ): IfarBaseResponse<UpdateUsersCallStateEntity>

    @FormUrlEncoded
    @POST("/index.php/api/common/index")
    suspend fun checkUserCallState(
        @Field("fun_name") fun_name: String,
        @Field("userIDs") company_id: String,
        @Field("uid") uid: String,
        @Field("token") token: String,
    ): IfarBaseResponse<CheckUserCallStateEntity>
}